package com.tutorialspoint.constructorDI;

public class TextEditor {
	private final SpellChecker spellChecker;

	public TextEditor(SpellChecker spellChecker) {
		System.out.println("Inside TextEditor constructor." );
		this.spellChecker = spellChecker;
	}
	public void spellCheck() {
		spellChecker.checkSpelling();
	}

	/*@Autowired
	private SpellChecker spellChecker;

	public TextEditor() {
		System.out.println("Inside TextEditor constructor." );
	}
	public SpellChecker getSpellChecker( ){
		return spellChecker;
	}
	public void spellCheck(){
		spellChecker.checkSpelling();
	}*/
}